package com.manage.modules.mapper;

import com.manage.modules.domain.TBaseStationStateYun;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 站点状态列表Mapper接口
 *
 * @author wx
 * @date 2021-09-07
 */
public interface TBaseStationStateYunMapper extends BaseMapper<TBaseStationStateYun> {

    /**
     * 查询每个站点最新的状态数据
     */
    @Select(value = "SELECT\n" +
            "\t* \n" +
            "FROM\n" +
            "\tt_base_station_state_yun \n" +
            "WHERE\n" +
            "\tid IN (\n" +
            "\tSELECT\n" +
            "\t\tmax( id ) \n" +
            "\tFROM\n" +
            "\t\tt_base_station_state_yun \n" +
            "\tGROUP BY\n" +
            "\tstation_id_c)")
    List<TBaseStationStateYun> selectNewGroupByStationIdc();
}
